﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BuMenSZ.aspx.cs" Inherits="Web.Pages.YongShui.BuMenSZ" Theme="Default" %>

<%@ Register TagPrefix="dx" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>


<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>




 
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
     <script type="text/javascript">
         function keyEnter(index) {
             var key = event.keyCode;
             if (key == 13) {
                 var controls = new Array();
                 controls[0] = document.getElementById("txtSheShuiDXFLDM_I");
                 controls[1] = document.getElementById("txtSheShuiDXFLMC_I");
                 controls[2] = document.getElementById("txtHangYeLXFLBM_I");
                 controls[3] = document.getElementById("txtHangYeLXFLMC_I");

                 index = index + 1;
                 if (index == controls.length) {
                     index = 0;
                 }
                 controls[index].focus();
             }
         }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            部门设置
        </div>
        <div style="height: 3px;"></div>
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <div align="center">
                    <div>
                        <dx:ASPxGridView ID="gvList" runat="server" AutoGenerateColumns="False" KeyFieldName="ID"  Theme="Aqua1"  Width="80%">
                            <Columns>
                                <dx:GridViewDataTextColumn FieldName="S_BIANHAO" Caption="部门编号" Width="10%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_MINGCHENG" Caption="部门名称" Width="25%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_MIAOSHU" Caption="描述" Width="20%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_ZHANDIANMC" Caption="站点">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Width="5%">
                                    <DataItemTemplate>
                                        <asp:LinkButton ID="lnbModify" runat="server" CausesValidation="false" Text="修改"
                                            CommandArgument='<%#Eval("ID")%>' OnCommand="lnbModify_Command"></asp:LinkButton>
                                    </DataItemTemplate>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Width="5%">
                                    <DataItemTemplate>
                                        <asp:LinkButton OnClientClick="javascript:if(!window.confirm('注意：您确认删除吗？')){return false;}"
                                            ID="lnbDel" runat="server" CausesValidation="false" Text="删除" CommandArgument='<%#Eval("ID")%>' OnCommand="lnbDel_Command"></asp:LinkButton>
                                    </DataItemTemplate>
                                </dx:GridViewDataTextColumn>
                            </Columns>
                            <Settings  VerticalScrollableHeight= "280"  />
                        </dx:ASPxGridView>
                    </div>
                    <div style="height: 3px;"></div>
                    <div style="text-align: right">
                        <hr />
                        <dx:ASPxButton  ID="btnAdd" runat="server" Text="添加" OnClick="btnAdd_Click" UseSubmitBehavior="false" >
                            </dx:ASPxButton>
                    </div>
                    <div id="GridViewContentTable" runat="server">
                        <div class="tabletitle1" align="center">
                            <asp:Label runat="server" ID="lblOperateTip">添加</asp:Label>
                        </div>
                        <table style="width: 80%; margin: auto;">
                            <tr>
                                <td align="right" style="width: 40%">部门编号：
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtBuMenBH" runat="server" Width="60%" MaxLength="15">
                                        <ValidationSettings ValidationGroup="group">
                                            <RequiredField ErrorText="不能为空!" IsRequired="True" />
                                             <RegularExpression ErrorText="应为数字类型!" ValidationExpression="^[0-9]*[1-9][0-9]*$" />
                                        </ValidationSettings>
                                        <ClientSideEvents  KeyPress="function(s,e){keyEnter(0);}"
                                         />
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">部门名称：
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtBuMenMC" runat="server" Width="100%" MaxLength="30">
                                        <ValidationSettings ValidationGroup="group">
                                            <RequiredField ErrorText="不能为空!" IsRequired="True" />
                                        </ValidationSettings>
                                        <ClientSideEvents  KeyPress="function(s,e){keyEnter(1);}"
                                         />
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                             <tr>
                                <td align="right">站点：
                                </td>
                                <td>
                                    <dx:ASPxComboBox ID="cmbZhanDian" runat="server" ValueType="System.String">
                                        <ClientSideEvents  KeyPress="function(s,e){keyEnter(3);}"
                                         />
                                    </dx:ASPxComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="right"  style="vertical-align:top">描述：
                                </td>
                                <td>
                                    <dx:ASPxMemo ID="txtBuMenMS" runat="server" Height="55px" Width="100%">
                                        <ClientSideEvents  KeyPress="function(s,e){keyEnter(2);}"
                                         />
                                    </dx:ASPxMemo>
                                </td>
                            </tr>
                        </table>
                        <table id="GridViewButtonTable" runat="server" style="width:100%">
                            <tr>
                                <td><hr /></td>
                            </tr>
                            <tr>
                                <td style="text-align: right;">
                                    <dx:ASPxButton ID="ASPxButton1" runat="server" Text="保存" OnClick="btnSave_Click" UseSubmitBehavior="false">
                                        <ClientSideEvents Click="function(s, e) {
	                                               if (ASPxClientEdit.ValidateGroup('group')) {                 
                                                       e.processOnServer = true;             
                                                    } 
                                                    else 
                                                    { 
                                                       e.processOnServer = false; 
                                                    }
                                        }" />
                                    </dx:ASPxButton>
                                    <dx:ASPxButton  ID="btnCancel" runat="server" Text="放弃" OnClick="btnCancel_Click" UseSubmitBehavior="false" >
                                        </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
